package com.fin.zw.intelligentbot.controller.api;

import com.fin.zw.intelligentbot.annotation.CurrentUser;
import com.fin.zw.intelligentbot.entity.BaseEntity;
import com.fin.zw.intelligentbot.entity.CategoryLabel;
import com.fin.zw.intelligentbot.model.session.SessionModel;
import com.fin.zw.intelligentbot.service.CategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

import java.util.List;

@RestController
@RequestMapping("/api/category")
@Api(value = "客户分类标签", description = "客户分类标签")
public class CategoryController {

    @Autowired
    private CategoryService categoryService;

    @GetMapping("/fetch")
    @ApiOperation(value = "客户分类查询", notes = "客户分类查询")
    public ResponseEntity<List<BaseEntity>> getAiAccountList(@ApiIgnore @CurrentUser SessionModel sessionModel,
                                                             CategoryLabel condition) {
        List<BaseEntity> list = this.categoryService.fetch(sessionModel, condition);
        return ResponseEntity.ok().body(list);
    }
}
